<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="t" uri="/WEB-INF/tour.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Choose your tour</title>
</head>
<body>
	<t:header login="${sessionScope.login}"/>
	
	<h3> Offers </h3>
	
	<c:if test="${requestScope.entityList ne null}">
		
		<table>
		<c:forEach items="${requestScope.entityList}" var="entity">
			<t:tour voucher="${entity}"/>
			<p>
		</c:forEach>
		</table>
	
		
		<table border="1" cellpadding="5" cellspacing="5">
        <tr>
            <c:forEach begin="1" end="${requestScope.numberOfPages}" var="i">
             <c:choose>
                    <c:when test="${requestScope.pageNumber eq i}">
                        <td>${i}</td>
                    </c:when>
                    <c:otherwise>
                        <td><a href="controller?action=loadAllVouchers&pageNumber=${i}&address=TOUR_LIST">${i}</a></td>
                    </c:otherwise>
                </c:choose>
            </c:forEach>
        </tr>
    	</table>
    	
	
	
	<c:if test="${requestScope.pageNumber ne 1}">
			<a href="controller?action=loadAllVouchers&pageNumber=${requestScope.pageNumber - 1}&address=TOUR_LIST"> Previous </a>
	</c:if>
	
	<c:if test = "${requestScope.pageNumber lt requestScope.numberOfPages}">
    		<a href="controller?action=loadAllVouchers&pageNumber=${requestScope.pageNumber + 1}&address=TOUR_LIST"> Next </a>
    </c:if>
	
	</c:if>
	
</body>
</html>